<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>四瓣花</title>
  <style>
    * {
      margin: 0;
    }

    .container {
      position: relative;
      width: 100vw;
      height: 100vh;
    }

    input[type=radio] {
      -webkit-appearance: none;
      outline: none;
      border: none;
      width: 200px;
      height: 200px;
      transition: all 2s ease-in;
      z-index: 99;
    }


    #red {
      position: absolute;
      top: 10.5%;
      left: 27%;
      background: red;
      border-top-right-radius: 50%;
      border-bottom-left-radius: 50%;
    }

    #blue {
      position: absolute;
      top: 10.5%;
      right: 27%;
      background: blue;
      border-bottom-right-radius: 50%;
      border-top-left-radius: 50%;
    }

    #green {
      position: absolute;
      bottom: 10.5%;
      left: 27%;
      background: green;
      border-bottom-right-radius: 50%;
      border-top-left-radius: 50%;
    }

    #yellow {
      position: absolute;
      bottom: 10.5%;
      right: 27%;
      background: yellow;
      border-top-right-radius: 50%;
      border-bottom-left-radius: 50%;
    }

    #pink {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 100px;
      height: 100px;
      background-color: pink;
      /* border: 2px solid #000; */
    }

    /* input[type=radio]:checked {
      border-radius: 50%;
      background-color: #fff !important;
    } */

    #red:checked {
      border-radius: 50%;
      background-color: #fff;
      transform: translate(-20px, -20px);
    }

    #blue:checked {
      border-radius: 50%;
      background-color: #fff;
      transform: translate(20px, -20px);
    }

    #green:checked {
      border-radius: 50%;
      background-color: #fff;
      transform: translate(-20px, 20px);
    }

    #yellow:checked {
      border-radius: 50%;
      background-color: #fff;
      transform: translate(-20px, 20px);
    }

    #pink:checked {
      background-color: #fff;
      border-radius: 50%;
      border: none;
    }

    .bg {
      width: 100vm;
      height: 100vh;
      transition: all 1s eade-in;
    }

    #red:checked~div {
      background-color: red;
    }

    #blue:checked~div {
      background-color: blue;
    }

    #green:checked~div {
      background-color: green;
    }

    #yellow:checked~div {
      background-color: yellow;
    }

    #pink:checked~div {
      background-color: pink;
    }
  </style>
</head>

<body>
  <div class="container">
    <input type="radio" id="red" name="flower">
    <!-- <div></div> -->
    <input type="radio" id="blue" name="flower">
    <!-- <div></div> -->
    <input type="radio" id="green" name="flower">
    <!-- <div></div> -->
    <input type="radio" id="pink" name="flower">
    <!-- <div></div> -->
    <input type="radio" id="yellow" name="flower">
    <div class="bg"></div>
  </div>
</body>

</html>